package com.mycode.facade11.resolve;

import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;

// 文件保存类：子系统类
public class FileWriter {

    public void write(String encryptStr, String fileNameDes) {
        System.out.println("保存密文，写入文件。");
        try {
            FileOutputStream fileOutputStream = new FileOutputStream(fileNameDes);
            fileOutputStream.write(encryptStr.getBytes(StandardCharsets.UTF_8));
            fileOutputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
